//
//  ComUtil.h
//  HiZhua
//
//  Created by Jpwang on 2017/8/7.
//  Copyright © 2017年 Jpwang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ComUtil : NSObject

id isNil(id value);

BOOL isHexNumber(NSString *text);

BOOL isValidEmail(NSString *email);

BOOL isValidMobile(NSString *mobile);

NSString *currentTimeMillis(void);

NSString *appVersion(void);

NSString *systemVersion(void);

void saveValueByKey(id value, NSString *key);

id getValueByKey(NSString *key);

void removeValueByKey(NSString *key);

NSString *intToString(NSInteger number);

NSString *NSStringFromCATransform3D(CATransform3D tranform);

float getTextWidth(NSString *text, float width, float fontsize);

BOOL isInstallQQ(void);

BOOL isInstallWX(void);

BOOL isInstallSina(void);

NSString* dataToJson(id object);

id string2Json(NSString *str);

NSString *urlEncode(NSStringEncoding encoding, NSString *url);

NSDictionary* getObjectData(id obj);

NSString *dicToJSONString(NSDictionary *dic);

UIImage *clipImageWithCornerRadius(CGFloat cornerRadius, UIImage *originImage);

UIImage *createImageOfLC(float cornerRadius, CGSize size, UIColor *color);
UIImage *createImageOfRC(float cornerRadius, CGSize size, UIColor *color);
UIImage *createImageOfTC(float cornerRadius, CGSize size, UIColor *color);
UIImage *createImageOfBC(float cornerRadius, CGSize size, UIColor *color);
UIImage *stretchImage(UIImage *img, UIEdgeInsets insets);
UIImage *createGradientImage(CGSize size, UIColor *color1, UIColor *color2, int direct);

BOOL isIPhone5();

@end
